package com.demo;

import android.content.Context;
import android.view.Gravity;
import android.widget.TextView;
import android.widget.LinearLayout.LayoutParams;

public class HeadTextView extends TextView {
	
	private Integer resId;
	
	private String text;

	
	
	public HeadTextView(Context context,String text) {
		super(context);
		this.text=text;
		init();
	}
	
	private void init(){
		System.out.println("text size:"+SCREEN.HEAD_TEXT_VIEW_TEXT_SIZE);
		if(resId==null){
			LayoutParams params=new LayoutParams(LayoutParams.FILL_PARENT,LayoutParams.FILL_PARENT,1);
			setLayoutParams(params);
			setGravity(Gravity.CENTER);
			setText(text);
			setTextSize(SCREEN.HEAD_TEXT_VIEW_TEXT_SIZE);
		}else{
			inflate(getContext(), resId, null);
		}
	}
	

}
